import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2022-12-13
 * Time: 11:05
 * @author taoge
 */
public class Test {
    public static void main(String[] args) {

    }
}
//class Solution {
//    public boolean checkIfPangram(String sentence) {
//    char[] arr=sentence.toCharArray();
//    int[] arr1=new int[26];
//        for (int i = 0; i < arr.length; i++) {
//           arr1[arr[i]-'a']++;
//        }
//        for (int i = 0; i < 26; i++) {
//            if (arr1[i] == 0) {
//                return false;
//            }
//        }
//        return true;
//    }
//}
class Solution1 {
    public boolean checkIfPangram(String sentence) {
      int ret=0;
        for (int i = 0; i < sentence.length(); i++) {
            ret|=1<<(sentence.charAt(i)-'a');
        }
        return ret==(1<<26)-1;
    }
}

class Solution2 {
    public List<List<Integer>> generate(int numRows) {
        List<List<Integer>> ret = new ArrayList<>();

        for (int i = 0; i < numRows; i++) {
            List<Integer> integers = new ArrayList<>();
            for (int j = 0; j < i+1; j++) {
                 if(j==0 || j== i){
                     integers.add(1);
                 }else {
                     integers.add(ret.get(i-1).get(j)+ret.get(i-1).get(j-1));
                 }

            }
            ret.add(integers);
        }
        return ret;
    }
}

         class ListNode {
             int val;
             ListNode next;

             ListNode() {
             }

             ListNode(int val) {
                 this.val = val;
             }

             ListNode(int val, ListNode next) {
                 this.val = val;
                 this.next = next;
             }
         }
class Solution {
    public ListNode removeElements(ListNode head, int val) {
        if(head==null){
            return null;
        }
        ListNode cur=head;
        ListNode ret=head;
        while (cur.next.next!=null){
            if(cur.next.val==val){
                cur.next=cur.next.next;
            }
            ret=cur;
            cur=cur.next;
        }
        ListNode res=ret;
if(cur.val==val){
    ret.next=cur.next;
    if(cur.val==val){
        res.next=null;
    }
}else {
    ret=cur;
    cur=cur.next;
    if(cur.val==val){
        ret.next=null;
    }
}

        return  head;
    }
}











